/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.dianlan.protocol.active;

import info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BCD;
import static info.peigen.hotpot.component.gateway.dianlan.annotations.DianlanProtocol.DianlanProtocolDataType.BIN;

/**
 * <b>(DianlanBillingModelSetting)</b>
 * <p>
 * 计费模型设置
 * 客户充电费用计算，每半小时为一个费率段，共 48 段，每段对应尖峰平谷其中一个费率
 * 充电时桩屏幕按此费率分别显示已充电费和服务费
 * 帧类型码 0x58
 * 序列号域 007C
 * 数据长度
 * 帧校验域 4622
 *
 * @author czj
 * @version 1.0.0
 * @since 2022/2/9
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class DianlanBillingModelSetting {
    /** 桩编码 */
    @DianlanProtocol(length = 7, start = 0, end = 7, dataType = BCD)
    String stubNo;
    /** 计费模型编码 */
    @DianlanProtocol(length = 2, start = 7, end = 9, dataType = BCD)
    String billingModelCode;
    /** 尖费电费费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 9, end = 13, dataType = BIN)
    String highestElectricCharge;
    /** 尖服务费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 13, end = 17, dataType = BIN)
    String highestServiceCharge;
    /** 峰电费费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 17, end = 21, dataType = BIN)
    String highElectricCharge;
    /** 峰服务费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 21, end = 25, dataType = BIN)
    String highServiceCharge;
    /** 平电费费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 25, end = 29, dataType = BIN)
    String flatElectricCharge;
    /** 平服务费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 33, end = 37, dataType = BIN)
    String flatServiceCharge;
    /** 谷电费费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 37, end = 41, dataType = BIN)
    String lowestElectricCharge;
    /** 谷服务费率 精确到五位小数 */
    @DianlanProtocol(length = 4, start = 41, end = 45, dataType = BIN)
    String lowestServiceCharge;
    /** 计损比例 */
    @DianlanProtocol(length = 1, start = 45, end = 46, dataType = BIN)
    String countOfLoss;
    /** 以下均为设置时间段 */
    @Builder.Default
    @DianlanProtocol(length = 1, start = 46, end = 47, dataType = BIN)
    String time0000to0030 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 47, end = 48, dataType = BIN)
    String time0030to0100 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 48, end = 49, dataType = BIN)
    String time0100to0130 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 49, end = 50, dataType = BIN)
    String time0130to0200 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 50, end = 51, dataType = BIN)
    String time0200to0230 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 51, end = 52, dataType = BIN)
    String time0230to0300 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 52, end = 53, dataType = BIN)
    String time0300to0330 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 53, end = 54, dataType = BIN)
    String time0330to0400 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 54, end = 55, dataType = BIN)
    String time0400to0430 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 55, end = 56, dataType = BIN)
    String time0430to0500 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 56, end = 57, dataType = BIN)
    String time0500to0530 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 57, end = 58, dataType = BIN)
    String time0530to0600 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 58, end = 59, dataType = BIN)
    String time0600to0630 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 59, end = 60, dataType = BIN)
    String time0630to0700 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 60, end = 61, dataType = BIN)
    String time0700to0730 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 61, end = 62, dataType = BIN)
    String time0730to0800 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 62, end = 63, dataType = BIN)
    String time0800to0830 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 63, end = 64, dataType = BIN)
    String time0830to0900 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 64, end = 65, dataType = BIN)
    String time0900to0930 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 65, end = 66, dataType = BIN)
    String time0930to1000 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 66, end = 67, dataType = BIN)
    String time1000to1030 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 67, end = 68, dataType = BIN)
    String time1030to1100 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 68, end = 69, dataType = BIN)
    String time1100to1130 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 69, end = 70, dataType = BIN)
    String time1130to1200 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 70, end = 71, dataType = BIN)
    String time1200to1230 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 71, end = 72, dataType = BIN)
    String time1230to1300 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 72, end = 73, dataType = BIN)
    String time1300to1330 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 73, end = 74, dataType = BIN)
    String time1330to1400 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 74, end = 75, dataType = BIN)
    String time1400to1430 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 75, end = 76, dataType = BIN)
    String time1430to1500 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 76, end = 77, dataType = BIN)
    String time1500to1530 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 77, end = 78, dataType = BIN)
    String time1530to1600 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 78, end = 79, dataType = BIN)
    String time1600to1630 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 79, end = 80, dataType = BIN)
    String time1630to1700 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 80, end = 81, dataType = BIN)
    String time1700to1730 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 81, end = 82, dataType = BIN)
    String time1730to1800 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 82, end = 83, dataType = BIN)
    String time1800to1830 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 83, end = 84, dataType = BIN)
    String time1830to1900 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 84, end = 85, dataType = BIN)
    String time1900to1930 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 85, end = 86, dataType = BIN)
    String time1930to2000 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 86, end = 87, dataType = BIN)
    String time2000to2030 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 87, end = 88, dataType = BIN)
    String time2030to2100 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 88, end = 89, dataType = BIN)
    String time2100to2130 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 89, end = 90, dataType = BIN)
    String time2130to2200 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 90, end = 91, dataType = BIN)
    String time2200to2230 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 91, end = 92, dataType = BIN)
    String time2230to2300 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 92, end = 93, dataType = BIN)
    String time2300to2330 = "01";
    @Builder.Default
    @DianlanProtocol(length = 1, start = 93, end = 94, dataType = BIN)
    String time2330to0000 = "01";
}